The present invention relates to techniques for updating cyclic redundancy check bytes in a data storage system, and more particularly, to techniques for updating cyclic redundancy check bytes to correspond to a reassigned logical block address.
A computer host system can store bytes of data onto a magnetic hard disk using a disk drive. The disk drive writes the data bytes onto the magnetic hard disk using a write element. Disk drives systems typically write data bytes onto disks in 512 byte long sectors. Each sector is associated with a logical block address (LBA) that identifies the location of the sector on the disk. The host system transfers data bytes and corresponding LBAs for each sector to the disk drive.
The disk drive generates error correction code (ECC) check bytes and cyclic redundancy check (CRC) bytes to correct errors in the data bytes. ECC and CRC engines generate the check bytes as soon as the disk drive receives the data bytes from the host. The ECC and CRC check bytes are used to protect the data bytes from errors using well known encoding processes.
ECC and CRC engines seed both the data bytes and the LBA into the encoding processes used to generate the ECC and CRC check bytes for each sector. The LBA is not written onto the disk. However, the ECC and CRC engines treat the data bytes and the LBA for a sector as one set of bytes that is used to generate the ECC and CRC check bytes.
When the disk drive system reads data from the disk, the ECC and CRC engines decode the ECC and CRC bytes to detect and correct errors within the data bytes. The ECC engine points out which of the data bytes within a sector, if any, contain errors. The ECC engine can calculate the location and the value of errors within the sector. For example, the ECC engine may determine that one or more of the data bytes within a sector contain errors. The ECC engine can correct up to a programmable number of errors within the data bytes.
As another example, the ECC engine may determine that one or more the of LBA bytes that correspond to a sector of data contain errors. If the LBA encoded into the ECC check bytes does not match the LBA from which the data was read, the ECC engine determines that the disk drive read data from the wrong sector.
Magnetic disks often contain small defects. These defects prevent data from being accurately written onto and read from portions of the disk. Prior art systems have been developed to log the sectors of a disk that contain such defects. These logs record the logical block addresses (LBAs) of the sectors on a particular disk that contain defects. When a host computer system attempts to write data bytes to an LBA, the disk drive system checks to see if that LBA is recorded in the log as an LBA that contains a defect.
If the LBA for a sector of data is recorded in the defect log list, the disk drive system reassigns the data to a different LBA on the disk that does not contain a defect. The LBA reassignment process occurs after the CRC engine has calculated the CRC check bytes and stored the data and check bytes into DRAM. Thus, the CRC check bytes were calculated based on the old LBA. After the data bytes have been assigned a new sector with a new LBA, the CRC check bytes that were calculated based on the old LBA can no longer be relied upon to correct errors in the data.
The CRC engine can calculate new CRC bytes using the new LBA and replace the old CRC bytes with the new CRC bytes. However, this process uses a substantial amount of system time.
Also, the CRC engine must recalculate the CRC bytes based on data bytes that have temporarily been stored in DRAM before they are written onto the disk. The DRAM often introduces errors into the data bytes depending on the soft error rate of the DRAM. If the DRAM introduces errors into the data bytes, the new CRC bytes will be based on corrupted data bytes. Thus, if the new CRC bytes are subsequently used to detect errors in the sector, the CRC engine will restore the data bytes to the corrupted data values.
Therefore, it would be desirable to provide faster and more accurate techniques for updating CRC check bytes for data bytes that have been reassigned to a new LBA.